<template>
    <div>
        <van-nav-bar title="商品列表" left-text="返回" left-arrow @click-left="() => { $router.push('/') }" fixed />
        <div style="height: 45px;"></div>
        <van-search v-model="value" shape="round" background="#4fc08d" placeholder="请输入搜索关键词" fixed />
        <div v-for="item in goods">
            <router-link :to="'/detail/' + item.goods_id">
                <van-card :price="item.goods_price" :title="item.goods_name"
                    :thumb="item.goods_big_logo ? item.goods_big_logo : 'https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg'"></van-card>
            </router-link>

            <van-skeleton title :row="3" />
        </div>

    </div>
</template>

<script setup>
import { goodsApi, qsearchApi } from '@/api/api';
import { ref, watch } from 'vue';
import { useRoute } from 'vue-router';
const route = useRoute()
let goods = ref([])
let value=ref('')
goodsApi(route.params.query).then(res => {
    console.log('列表数据', res);
    goods.value = res.data.message.goods
})
</script>

<style lang="scss" scoped></style>